<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/** 
<span class='line'>  2</span>  * 新しいADOのコネクションを作成する
<span class='line'>  3</span>  * @class ADOを使ったデータベースへの接続を行うクラス。&lt;br/>
<span class='line'>  4</span>           通常はこのクラスを直接使用せず、サブクラスを使います。
<span class='line'>  5</span>  * @param {String} connectString 接続文字列
<span class='line'>  6</span>  * @param {String} userName ユーザ名
<span class='line'>  7</span>  * @param {String} password パスワード
<span class='line'>  8</span>  */</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">AdoConnection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">connectString</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">password</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">  </span><span class="NAME">this.con</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"ADODB.Connection"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">  </span><span class="NAME">this.con.Open</span><span class="PUNC">(</span><span class="NAME">connectString</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">password</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> 
<span class='line'> 14</span> </span><span class="COMM">/**
<span class='line'> 15</span>  * Schema Enumの定数：Table(20)
<span class='line'> 16</span>  */</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="NAME">AdoConnection.AD_SCHEMA_TABLES</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">20</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> 
<span class='line'> 19</span> </span><span class="COMM">/**
<span class='line'> 20</span>  * DataTypeEnumの定数：adArray(0x2000)
<span class='line'> 21</span>  */</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_ARRAY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0x2000</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="COMM">/**
<span class='line'> 24</span>  * DataTypeEnumの定数：adBigInt(20)
<span class='line'> 25</span>  */</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_BIGINT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">20</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="COMM">/**
<span class='line'> 28</span>  * DataTypeEnumの定数：adBinary(128)
<span class='line'> 29</span>  */</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_BINARY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">128</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="COMM">/**
<span class='line'> 32</span>  * DataTypeEnumの定数：adBoolean(11)
<span class='line'> 33</span>  */</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_BOOLEAN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">11</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="COMM">/**
<span class='line'> 36</span>  * DataTypeEnumの定数：adBSTR(8)
<span class='line'> 37</span>  */</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_BSTR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="COMM">/**
<span class='line'> 40</span>  * DataTypeEnumの定数：adChapter(136)
<span class='line'> 41</span>  */</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_CHAPTER</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">136</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="COMM">/**
<span class='line'> 44</span>  * DataTypeEnumの定数：adChar(129)
<span class='line'> 45</span>  */</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_CHAR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">129</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="COMM">/**
<span class='line'> 48</span>  * DataTypeEnumの定数：adCurrency(6)
<span class='line'> 49</span>  */</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_CURRENCY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="COMM">/**
<span class='line'> 52</span>  * DataTypeEnumの定数：adDate(7)
<span class='line'> 53</span>  */</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_DATE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="COMM">/**
<span class='line'> 56</span>  * DataTypeEnumの定数：adDBDate(133)
<span class='line'> 57</span>  */</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_DBDATE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">133</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="COMM">/**
<span class='line'> 60</span>  * DataTypeEnumの定数：adDBTime(134)
<span class='line'> 61</span>  */</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_DBTIME</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">134</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="COMM">/**
<span class='line'> 64</span>  * DataTypeEnumの定数：adDBTimeStamp(135)
<span class='line'> 65</span>  */</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_DBTIMESTAMP</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">135</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="COMM">/**
<span class='line'> 68</span>  * DataTypeEnumの定数：adDecimal(14)
<span class='line'> 69</span>  */</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_DECIMAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">14</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="COMM">/**
<span class='line'> 72</span>  * DataTypeEnumの定数：adDouble(5)
<span class='line'> 73</span>  */</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_DOUBLE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="COMM">/**
<span class='line'> 76</span>  * DataTypeEnumの定数：adEmpty(0)
<span class='line'> 77</span>  */</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_EMPTY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="COMM">/**
<span class='line'> 80</span>  * DataTypeEnumの定数：adError(10)
<span class='line'> 81</span>  */</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_ERROR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="COMM">/**
<span class='line'> 84</span>  * DataTypeEnumの定数：adFileTime(64)
<span class='line'> 85</span>  */</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_FILETIME</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">64</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="COMM">/**
<span class='line'> 88</span>  * DataTypeEnumの定数：adGUID(72)
<span class='line'> 89</span>  */</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_GUID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">72</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="COMM">/**
<span class='line'> 92</span>  * DataTypeEnumの定数：adIDispatch(9)
<span class='line'> 93</span>  */</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_IDISPATCH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">9</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="COMM">/**
<span class='line'> 96</span>  * DataTypeEnumの定数：adInteger(3)
<span class='line'> 97</span>  */</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_INTEGER</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="COMM">/**
<span class='line'>100</span>  * DataTypeEnumの定数：adIUnknown(13)
<span class='line'>101</span>  */</span><span class="WHIT">
<span class='line'>102</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_IUNKNOWN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">13</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="COMM">/**
<span class='line'>104</span>  * DataTypeEnumの定数：adLongVarBinary(205)
<span class='line'>105</span>  */</span><span class="WHIT">
<span class='line'>106</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_LONGVARBINARY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">205</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="COMM">/**
<span class='line'>108</span>  * DataTypeEnumの定数：adLongVarChar(201)
<span class='line'>109</span>  */</span><span class="WHIT">
<span class='line'>110</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_LONGVARCHAR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">201</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="COMM">/**
<span class='line'>112</span>  * DataTypeEnumの定数：adLongVarWChar(203)
<span class='line'>113</span>  */</span><span class="WHIT">
<span class='line'>114</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_LONGVARWCHAR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">203</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span> </span><span class="COMM">/**
<span class='line'>116</span>  * DataTypeEnumの定数：adNumeric(131)
<span class='line'>117</span>  */</span><span class="WHIT">
<span class='line'>118</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_NUMERIC</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">131</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> </span><span class="COMM">/**
<span class='line'>120</span>  * DataTypeEnumの定数：adPropVariant(138)
<span class='line'>121</span>  */</span><span class="WHIT">
<span class='line'>122</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_PROPVARIANT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">138</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="COMM">/**
<span class='line'>124</span>  * DataTypeEnumの定数：adSingle(4)
<span class='line'>125</span>  */</span><span class="WHIT">
<span class='line'>126</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_SINGLE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> </span><span class="COMM">/**
<span class='line'>128</span>  * DataTypeEnumの定数：adSmallInt(2)
<span class='line'>129</span>  */</span><span class="WHIT">
<span class='line'>130</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_SMALLINT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="COMM">/**
<span class='line'>132</span>  * DataTypeEnumの定数：adTinyInt(16)
<span class='line'>133</span>  */</span><span class="WHIT">
<span class='line'>134</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_TINYINT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="COMM">/**
<span class='line'>136</span>  * DataTypeEnumの定数：adUnsignedBigInt(21)
<span class='line'>137</span>  */</span><span class="WHIT">
<span class='line'>138</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_UNSIGNEDBIGINT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">21</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>139</span> </span><span class="COMM">/**
<span class='line'>140</span>  * DataTypeEnumの定数：adUnsignedInt(19)
<span class='line'>141</span>  */</span><span class="WHIT">
<span class='line'>142</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_UNSIGNEDINT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">19</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="COMM">/**
<span class='line'>144</span>  * DataTypeEnumの定数：adUnsignedSmallInt(18)
<span class='line'>145</span>  */</span><span class="WHIT">
<span class='line'>146</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_UNSIGNEDSMALLINT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">18</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> </span><span class="COMM">/**
<span class='line'>148</span>  * DataTypeEnumの定数：adUnsignedTinyInt(17)
<span class='line'>149</span>  */</span><span class="WHIT">
<span class='line'>150</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_UNSIGNEDTINYINT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">17</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span> </span><span class="COMM">/**
<span class='line'>152</span>  * DataTypeEnumの定数：adUserDefined(132)
<span class='line'>153</span>  */</span><span class="WHIT">
<span class='line'>154</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_USERDEFINED</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">132</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span> </span><span class="COMM">/**
<span class='line'>156</span>  * DataTypeEnumの定数：adVarBinary(204)
<span class='line'>157</span>  */</span><span class="WHIT">
<span class='line'>158</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_VARBINARY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">204</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>159</span> </span><span class="COMM">/**
<span class='line'>160</span>  * DataTypeEnumの定数：adVarChar(200)
<span class='line'>161</span>  */</span><span class="WHIT">
<span class='line'>162</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_VARCHAR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">200</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>163</span> </span><span class="COMM">/**
<span class='line'>164</span>  * DataTypeEnumの定数：adVariant(12)
<span class='line'>165</span>  */</span><span class="WHIT">
<span class='line'>166</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_VARIANT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">12</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> </span><span class="COMM">/**
<span class='line'>168</span>  * DataTypeEnumの定数：adVarNumeric(139)
<span class='line'>169</span>  */</span><span class="WHIT">
<span class='line'>170</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_VARNUMERIC</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">139</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>171</span> </span><span class="COMM">/**
<span class='line'>172</span>  * DataTypeEnumの定数：adVarWChar(202)
<span class='line'>173</span>  */</span><span class="WHIT">
<span class='line'>174</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_VARWCHAR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">202</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>175</span> </span><span class="COMM">/**
<span class='line'>176</span>  * DataTypeEnumの定数：adWChar(130)
<span class='line'>177</span>  */</span><span class="WHIT">
<span class='line'>178</span> </span><span class="NAME">AdoConnection.AD_DATATYPE_WCHAR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">130</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>179</span> 
<span class='line'>180</span> </span><span class="COMM">/** 
<span class='line'>181</span>  * 新しいADOのコネクションを作成し、ブロックを実行します。
<span class='line'>182</span>  * ブロックが指定されていない場合は、作成したADOのコネクションを返します。
<span class='line'>183</span>  * @param {String} connectString 接続文字列
<span class='line'>184</span>  * @param {String} userName ユーザ名
<span class='line'>185</span>  * @param {String} password パスワード
<span class='line'>186</span>  * @param {Function} block ブロック
<span class='line'>187</span>  * @return {Object} ブロックが指定されていない場合は、作成したADOのコネクション
<span class='line'>188</span>  */</span><span class="WHIT">
<span class='line'>189</span> </span><span class="NAME">AdoConnection.open</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">connectString</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">password</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">block</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">isFunction</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">AdoConnection</span><span class="PUNC">(</span><span class="NAME">connectString</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">password</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>193</span> 
<span class='line'>194</span> </span><span class="WHIT">  </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">con</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">AdoConnection</span><span class="PUNC">(</span><span class="NAME">connectString</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">password</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">    </span><span class="NAME">block</span><span class="PUNC">(</span><span class="NAME">con</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">finally</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">con</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">      </span><span class="NAME">con.close</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>202</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>203</span> 
<span class='line'>204</span> </span><span class="COMM">// Prototypes of AdoConnection</span><span class="WHIT">
<span class='line'>205</span> </span><span class="NAME">AdoConnection.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">  </span><span class="COMM">// private</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">  </span><span class="NAME">getRawConnection</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.con</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>211</span>    * コネクションの接続文字列を取得する。
<span class='line'>212</span>    * @return {String} コネクションの接続文字列
<span class='line'>213</span>    */</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">  </span><span class="NAME">getConnectionString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.con.ConnectionString</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>218</span>    * 指定されたsqlを実行し、ハッシュ{fieldName: value}の配列として値を返す。
<span class='line'>219</span>    * @param {String} sql 実行するSQL
<span class='line'>220</span>    * @return {Array} ハッシュ{fieldName: value}の配列
<span class='line'>221</span>    */</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT">  </span><span class="NAME">executeQuery</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sql</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT">      </span><span class="COMM">// SQLの実行</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.con.Execute</span><span class="PUNC">(</span><span class="NAME">sql</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.convertToArrayRs</span><span class="PUNC">(</span><span class="NAME">rs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">      </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">finally</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">rs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">        </span><span class="NAME">rs.Close</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>236</span>    * 指定されたsqlを実行する。
<span class='line'>237</span>    * @param {String} sql 実行するSQL
<span class='line'>238</span>    */</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">  </span><span class="NAME">executeUpdate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sql</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">    </span><span class="COMM">// SQLの実行</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">    </span><span class="NAME">this.con.Execute</span><span class="PUNC">(</span><span class="NAME">sql</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">  </span><span class="COMM">// private</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">  </span><span class="COMM">// Recordsetを配列にコンバートする。</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT">  </span><span class="NAME">convertToArrayRs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT">    </span><span class="COMM">// フィールドリストの取得</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Enumerator</span><span class="PUNC">(</span><span class="NAME">rs.Fields</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> 
<span class='line'>249</span> </span><span class="WHIT">    </span><span class="COMM">// データの取得</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>251</span> 
<span class='line'>252</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">rs.EOF</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">record</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">fe.moveFirst</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">fe.atEnd</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">fe.moveNext</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fe.item</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">        </span><span class="NAME">record</span><span class="PUNC">[</span><span class="NAME">field.Name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">field.Value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">      </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">record</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>259</span> 
<span class='line'>260</span> </span><span class="WHIT">      </span><span class="NAME">rs.MoveNext</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>262</span> 
<span class='line'>263</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>266</span>    * 指定されたsqlを実行するコマンドを作成します。
<span class='line'>267</span>    * @param {String} sql 実行するSQL
<span class='line'>268</span>    * @return {Object} コマンドオブジェクト
<span class='line'>269</span>    */</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">  </span><span class="NAME">createCommand</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sql</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">AdoCommand</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sql</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>274</span>    * データベースの接続を閉じる。
<span class='line'>275</span>    */</span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT">  </span><span class="NAME">close</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT">    </span><span class="NAME">this.con.Close</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>280</span>    * トランザクションを開始します。
<span class='line'>281</span>    * @return {Number} トランザクションネストレベル
<span class='line'>282</span>    */</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">  </span><span class="NAME">beginTrans</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.con.BeginTrans</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>287</span>    * トランザクションをコミットします。
<span class='line'>288</span>    */</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">  </span><span class="NAME">commitTrans</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT">    </span><span class="NAME">this.con.CommitTrans</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>293</span>    * トランザクションをロールバックします。
<span class='line'>294</span>    */</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">  </span><span class="NAME">rollbackTrans</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">    </span><span class="NAME">this.con.RollbackTrans</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>299</span>    * テーブル名一覧を取得します。
<span class='line'>300</span>    * @param {String} schema (オプション)スキーマを指定します。
<span class='line'>301</span>    * @return {Array} テーブル名の配列を返します。
<span class='line'>302</span>    */</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT">  </span><span class="NAME">getTableNames</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">schema</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.con.OpenSchema</span><span class="PUNC">(</span><span class="NAME">AdoConnection.AD_SCHEMA_TABLES</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arrayToSafeArray</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">undefined</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">schema</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"TABLE"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.convertToArrayRs</span><span class="PUNC">(</span><span class="NAME">rs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT">    </span><span class="NAME">array.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT">      </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="PUNC">[</span><span class="STRN">"TABLE_NAME"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> 
<span class='line'>311</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>314</span>    * 指定したテーブルのフィールド名一覧を取得します。
<span class='line'>315</span>    * @param {String} tableName フィールド名一覧を取得するテーブル名を指定します。
<span class='line'>316</span>    * @return {Array} フィールド名一覧を返します。
<span class='line'>317</span>    */</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT">  </span><span class="NAME">getFieldNames</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">tableName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT">    </span><span class="COMM">// フィールドリスト取得のためのSQL空実行</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.con.Execute</span><span class="PUNC">(</span><span class="STRN">"SELECT * FROM "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">tableName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>321</span> 
<span class='line'>322</span> </span><span class="WHIT">    </span><span class="COMM">// フィールドリストの取得</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Enumerator</span><span class="PUNC">(</span><span class="NAME">rs.Fields</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>324</span> 
<span class='line'>325</span> </span><span class="WHIT">    </span><span class="COMM">// データの取得</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> 
<span class='line'>328</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">fe.moveFirst</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">fe.atEnd</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">fe.moveNext</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT">      </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">fe.item</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">Name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>331</span> 
<span class='line'>332</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>333</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>335</span>    * 指定したテーブルのフィールド情報一覧を取得します。[{カラム名:カラムタイプ}]
<span class='line'>336</span>    * @param {String} tableName フィールド情報一覧を取得するテーブル名を指定します。
<span class='line'>337</span>    * @return {Array} フィールド情報一覧を返します。
<span class='line'>338</span>    */</span><span class="WHIT">
<span class='line'>339</span> </span><span class="WHIT">  </span><span class="NAME">getFieldInfo</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">tableName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>340</span> </span><span class="WHIT">    </span><span class="COMM">// フィールドリスト取得のためのSQL空実行</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.con.Execute</span><span class="PUNC">(</span><span class="STRN">"SELECT * FROM "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">tableName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>342</span> 
<span class='line'>343</span> </span><span class="WHIT">    </span><span class="COMM">// フィールドリストの取得</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Enumerator</span><span class="PUNC">(</span><span class="NAME">rs.Fields</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>345</span> 
<span class='line'>346</span> </span><span class="WHIT">    </span><span class="COMM">// データの取得</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>348</span> 
<span class='line'>349</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">fe.moveFirst</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">fe.atEnd</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">fe.moveNext</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">item</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fe.item</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT">      </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'Name'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">item.Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Type'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">item.Type</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>353</span> 
<span class='line'>354</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>356</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>357</span> </span></pre></body></html>